import { HttpException } from "@/core/HttpException";
import { Catch } from "@midwayjs/core";
import { Context } from "@midwayjs/koa";

@Catch()
export class ErrorFilter {
  async catch(err: HttpException, ctx: Context) {
    // 所有的未分类错误会到这里
    console.log(err);
    
    return {
      success: false,
      ...err
    };
  }
}
